package org.elasticsearch;

import org.elasticsearch.common.settings.Settings;

import java.util.Map;

public class ObsRepositoryPluginTest {

    @org.junit.jupiter.api.Test
    public void testRepositoryPluginInit() {

        Settings settings1 = Settings.builder().put(ObsClientSettings.BUCKET.getKey(), "bucket")
                .put(ObsClientSettings.ACCESS_KEY.getKey(), "access_key")
                .put(ObsClientSettings.SECRET_ACCESS_KEY.getKey(), "secret_key")
                .put(ObsClientSettings.ENDPOINT.getKey(), "endpoint")
                .build();
        final Map<String, ObsClientSettings> settings2 = ObsClientSettings.load(settings1);
        ObsService obsService = new ObsService();
        final ObsClientSettings defaultSettings = settings2.get("default");
        obsService.buildClient(defaultSettings);
        ObsRepositoryPlugin plugin = new ObsRepositoryPlugin(settings1, obsService);
        assert plugin.service != null;

    }
}
